package kr.hkit.powerjava.chapter07.work;

public class Eworld {
	private int gubun;	//자유이용권 1, 입장권 0
	private int age;	//나이
	private int hour; 	//입장 시간
	
	public Eworld(int gubun, int age, int hour) {
		this.gubun = gubun;
		this.age = age;
		this.hour = hour;
	}
	
	public void setData(int gubun, int age, int hour) {
		this.gubun = gubun;
		this.age = age;
		this.hour = hour;
	}
	
	public int getPrice(){
		int price = 0;
		if (gubun == 1){	//자유이용권
			if (hour > 16){		//야간
				if (age < 3){						//영아
					price = 0;
				}else if (age < 13 || age >64){		//소인
					price = 21000;
				}else{								//대인
					price = 29000;
				}
			}else{				//주간
				if (age < 3){						//영아
					price = 0;
				}else if (age < 13 || age >64){		//소인
					price = 25000;
				}else{								//대인
					price = 34000;
				}
			}
		}else{					//입장권
			if (hour > 16){		//야간
				if (age < 3){						//영아
					price = 0;
				}else if (age < 13 || age >64){		//소인
					price = 17000;
				}else{								//대인
					price = 23000;
				}
			}else{				//주간
				if (age < 3){						//영아
					price = 0;
				}else if (age < 13 || age >64){		//소인
					price = 20000;
				}else{								//대인
					price = 27000;
				}
			}
		}
		return price;
	}

	
	@Override
	public String toString() {
		return "Eworld [gubun=" + gubun + ", age=" + age + ", hour=" + hour
				+ ", getPrice()=" + getPrice() + "]";
	}

	
}
